<!doctype html>
<html>
<head>
    <title>Demo &raquo; Multiple gridster intances &raquo; gridster.js</title>
    <link rel="stylesheet" type="text/css" href="demo.css">
    <link rel="stylesheet" type="text/css" href="/scripts/gridster.js/jquery.gridster.min.css">
    <script src="/scripts/jquery/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/scripts/gridster.js/jquery.gridster.min.js" type="text/javascript" charset="utf-8"></script>
</head>

<body>

<h1>Multiple gridster instances with different configurations</h1>

<p>When using multiple gridster instances on the same page you can scope the CSS code generated by gridster using <code>namespace</code> config
    option.</p>

<h2>Demo 1</h2>

<div id="demo-1" class="gridster">
    <ul>
        <li data-row="1" data-col="1" data-sizex="2" data-sizey="2">0</li>
        <li data-row="1" data-col="3" data-sizex="1" data-sizey="2">1</li>
        <li data-row="1" data-col="4" data-sizex="1" data-sizey="1">2</li>
        <li data-row="3" data-col="2" data-sizex="3" data-sizey="1">3</li>
        <li data-row="4" data-col="1" data-sizex="1" data-sizey="1">4</li>
        <li data-row="3" data-col="1" data-sizex="1" data-sizey="1">5</li>
        <li data-row="4" data-col="2" data-sizex="1" data-sizey="1">6</li>
        <li data-row="5" data-col="2" data-sizex="1" data-sizey="1">7</li>
        <li data-row="4" data-col="4" data-sizex="1" data-sizey="1">8</li>
    </ul>
</div>


<h2>Demo 2</h2>

<div id="demo-2" class="gridster">
    <ul>
        <li data-row="1" data-col="1" data-sizex="2" data-sizey="2">0</li>
        <li data-row="1" data-col="3" data-sizex="1" data-sizey="2">1</li>
        <li data-row="1" data-col="4" data-sizex="1" data-sizey="1">2</li>
        <li data-row="3" data-col="2" data-sizex="3" data-sizey="1">3</li>
        <li data-row="4" data-col="1" data-sizex="1" data-sizey="1">4</li>
        <li data-row="3" data-col="1" data-sizex="1" data-sizey="1">5</li>
        <li data-row="4" data-col="2" data-sizex="1" data-sizey="1">6</li>
        <li data-row="5" data-col="2" data-sizex="1" data-sizey="1">7</li>
        <li data-row="4" data-col="4" data-sizex="1" data-sizey="1">8</li>
    </ul>
</div>

<script type="text/javascript">
    var gridster = [];

    $(function () {

        gridster[0] = $("#demo-1 ul").gridster({
            namespace: '#demo-1',
            widget_base_dimensions: [100, 55],
            widget_margins: [5, 5]
        }).data('gridster');

        gridster[1] = $("#demo-2 ul").gridster({
            namespace: '#demo-2',
            widget_base_dimensions: [200, 110],
            widget_margins: [10, 10]
        }).data('gridster');

    });
</script>
</body>
</html>
